<html>
<body>

<div style='display:table; border: 1px solid black; width: 500px; height: 500px;'>
  <div style='display:table-row; border: 1px solid red;'>
    <div style='display:table-cell; border: 1px solid blue;'>
      <div style='display:table; border: 1px solid green; width: 100%; height: 100%; padding: 10px; box-sizing: border-box; -moz-box-sizing: border-box;'>
        <div style='display:table-row; border: 1px solid cyan;'>
          <div style='display:table-cell; border: 1px solid magenta;'>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>
